<template>
	<view class="flex-col homepage">
		<view class="flex-col wrapper" v-for="(item, index) in this.CellIntermediate" @click="HousingDetails(item)">
			<view class="flex-row wraper-row">
				<view class="box">
					<view class="u-line-1 text" v-if="item.defaultState=='是'">默认</view>
					<view class="u-line-1 text" v-if="item.defaultState!='是'">小区:</view>
				</view>
				<view class="u-line-1 text-two">{{item.communityName}}</view>
				<view class="box" style="width:50px;">
					<view class="u-line-1 text" style="width:70px;">{{item.auditState}}</view>
				</view>
			</view>
			<u-line class="line" margin="0rpx 0rpx 26rpx 0rpx"></u-line>
			<view class="flex-row wraper-row-two">
				<view class="u-line-1 text-three">房间号</view>
				<view class="u-line-1 text-four">{{item.howPortal}}</view>
			</view>
			<view class="flex-row wraper-row-three">
				<view class="u-line-1 text-five">业主</view>
				<view class="u-line-1 text-six">{{user.userName}}</view>
			</view>
			<view class="flex-row wraper-row-four">
				<view class="u-line-1 text-seven">房屋状态</view>
				<view class="u-line-1 text-eight">{{item.state}}</view>
			</view>
		</view>
		
				
		<view class="flex-row wrapper-two">
            <view class="u-line-1 text-nine" @click="addHome()">+ 添加房屋</view>
        </view>
	</view>
</template>
<script>
	export default {
		data() {
			return {
				user:{},
				CellIntermediate:{}
			}
		},
		onLoad() {
			this.WjxFindMyHome()
		},
		methods: {
			HousingDetails(data){
				uni.navigateTo({
				    url: './house/Housingdetails?data='+encodeURIComponent(JSON.stringify(data)),
				    success: function(res) {      
				    }
				})
			},
			addHome(){
				uni.navigateTo({
				    url: '../wjx/house/AddHousingInformation',
				    success: function(res) {
				        console.log(res)                
				    }
				})
			},
			WjxFindMyHome(){
				this.user = uni.getStorageSync('user')
				this.$axios({
					url: 'serverwg/WjxFindMyHome',
					data: {
						userId: this.user.userId
					},
					method: 'GET',
					success: (res) => {
						console.log(res)
						this.CellIntermediate=res.data.data.wvos
					}
				})
			}
		}
	}
</script>
<style lang="scss" scoped>
	/** 全局样式-开始,建议放在公共css样式文件中,比如common.css 或app.vue文件 */

	html,
	body {
		margin: 0;
		width: 100%;
		height: 100%;
		font-size: 16px
	}

	view,
	text,
	image {
		position: relative;
		box-sizing: border-box;
		flex-shrink: 0;
	}

	.flex-col {
		display: flex;
		align-items: flex-start;
		flex-direction: column;
	}

	.flex-row {
		display: flex;
		align-items: flex-start;
	}

	.flex-col .flex-row {
		width: 100%
	}

	/** 全局样式-结束*/

	.homepage {
		height: 1334rpx;
		padding: 54rpx 0rpx 0rpx 15rpx;
		border-color: #f2f2f2;
		font-size: 32rpx;
		color: 0rpx;

		.wrapper {
			width: 710rpx;
			margin-bottom: 30rpx;
			padding: 23rpx 0rpx 29rpx 40rpx;
			border-width: 2rpx;
			border-style: solid;
			border-size: 2px;
			border-color: rgba(221, 221, 221, 1);
			border-radius: 10rpx;

			.wraper-row {
				width: 568rpx;
				justify-content: space-between;
				margin: 0rpx 0rpx 18rpx 14rpx;

				.box {
					width: 80rpx;
					margin-top: 6rpx;
					border-width: 20rpx;
					border-radius: 10rpx;
					background: #006eff;

					.text {
						width: 62rpx;
						margin-left: 14rpx;
						font-size: 6rpx;
						color: rgba(255, 255, 255, 1);
					}
				}

				.text-two {
					width: 350rpx;
					margin-top: 6rpx;
				}

				.tag {
					border-radius: 6rpx;
					font-size: 6rpx;
					background: #ffe9d7;
					color: #ffa938;
				}
			}

			.line {
				width: 648rpx;
				height: 0rpx;
			}

			.wraper-row-two {
				width: 305rpx;
				justify-content: space-between;
				margin: 0rpx 0rpx 20rpx 6rpx;
				padding-right: 1rpx;

				.text-three {
					width: 104rpx;
					font-size: 4rpx;
					color: #9a9a9a;
				}

				.text-four {
					width: 188rpx;
					font-size: 4rpx;
					color: #000000;
				}
			}

			.wraper-row-three {
				width: 305rpx;
				justify-content: space-between;
				margin: 0rpx 0rpx 20rpx 6rpx;
				padding-right: 1rpx;

				.text-five {
					width: 104rpx;
					font-size: 4rpx;
					color: #9a9a9a;
				}

				.text-six {
					width: 188rpx;
					font-size: 4rpx;
					color: #000000;
				}
			}

			.wraper-row-four {
				width: 305rpx;
				justify-content: space-between;
				margin-left: 6rpx;
				padding-right: 1rpx;

				.text-seven {
					width: 104rpx;
					font-size: 4rpx;
					color: #9a9a9a;
				}

				.text-eight {
					width: 188rpx;
					font-size: 4rpx;
					color: #000000;
				}
			}
		}

		.wrapper-two {
			width: 558rpx;
			justify-content: center;
			margin-left: 66rpx;
			padding: 23rpx 0rpx;
			border-radius: 10rpx;
			background: #006eff;

			.text-nine {
				width: 176rpx;
				font-size: 32rpx;
				color: rgba(255, 255, 255, 1);
			}
		}
	}
</style>
